const {jwtDecode} = require("../utils");
module.exports = {
	async userMiddleware(req,res,next){
		try{
			// 接收到请求头token信息
			req.payload =  await jwtDecode(req.get("token"));
			next();
		}catch (err){
			res.json({
				ok:-2,
				msg:"token异常"
			})
		}

	}
}